<template>
	<div class="alertBox redUseMoney">
		<div class="alertBk"></div>
		<div class="wordBox">
			<div class="alertHead">
				<p class="tittle">使用金额详情</p>
				<div class="myClose" @click="closeActCashBack">
					<img src="~_assets/close.png" class="myClose"/>
				</div>
			</div>
			<div class="alertBody">
        <div class="playBox">
            <!-- <div class="butInfoMes alertExport">导出</div> -->
        </div>
				<div class="changeDiv">
					<bootstrap-table :my_columns="my_columns" :my_data="data1" :my_options="my_options" ref="table1"></bootstrap-table>
				</div>
				<div class="alertBut">
					<button class="isFalse" @click="closeActCashBack">取消</button>
					<!-- <button class="isTrue">确认</button> -->
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import { FIND_ACTIVITY_LIST_BY_CODE } from "@/config/url";
export default {
  props: ["items"],
  mounted: function() {
    this.findActCodeList();
  },
  data() {
    return {
      my_columns: [],
      data1: [],
      page: 1,
      size: 10,
      my_options: {
        pagination: true
        // sidePagination:'server'
      },
      config: {
        checkbox_rows: true,
        rows_selectable: true,
        card_title: "Vue Bootsrap 4 advanced table"
      }
    };
  },
  methods: {
    closeActCashBack() {
      this.$emit("closeActCashBack");
    },
    findActCodeList() {
      if (this.items.activityType == "994002") {
        this.my_columns = [
          {
            title: "序号",
            field: "",
            formatter: function(value, row, index) {
              return index + 1;
            }
          },
          {
            title: "会员账户",
            field: "menPhone"
          },
          {
            title: "充值/充电订单号",
            field: "rechargeOrder"
          },
          {
            title: "返现金额(元)",
            field: "cashbackMoney"
          },
          {
            title: "获取时间",
            field: "createTime"
          }
        ];
      } else {
        this.my_columns = [
          {
            title: "序号",
            field: "",
            formatter: function(value, row, index) {
              return index + 1;
            }
          },
          {
            title: "会员账户",
            field: "menPhone"
          },
          {
            title: "返现金额(元)",
            field: "cashbackMoney"
          },
          {
            title: "获取时间",
            field: "createTime"
          }
        ];
      }
      this.my_options = {
        pagination: true,
        sidePagination: "server",
        url: FIND_ACTIVITY_LIST_BY_CODE,
        queryParams: this.getParams
      };
    },
    getParams() {
      let param = {
        activityCode: this.items.activityCode,
        page: this.$refs.table1.local.options.pageNumber,
        size: this.$refs.table1.local.options.pageSize
      };
      return param;
    }
  }
};
</script>

<style lang="less">
.redUseMoney {
  .wordBox {
    width: 80%;
  }
  .alertBody,
  .bootstrap-table {
    padding-top: 0;
  }
  .changeDiv {
    width: 98%;
  }
}
</style>